package com.saybiu.controller;

import com.saybiu.domain.Collection;
import com.saybiu.service.UserService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * @Author wangwei
 * @Date 2021/4/21 15:12
 * @Version 1.0
 */
@RestController
public class CollectionController {
    @Resource
    private UserService userService;
    //查询收藏信息(userid)

    /**
     * 查询用户收藏信息
     * @param userId
     * @return
     */
    @GetMapping(value = "/collections")
    public List<Collection> queryCollection(Integer userId){
        //token获取userId
        List<Collection> collections = userService.queryUserCollection(userId);
        return collections;
    }
}
